import request from '@/utils/request'
import fileAPI from '@/utils/fileAPI'

export function list(data) {
  return request({
    url: '/plan/production/list',
    method: 'post',
    data: data
  })
}
export function listPlanProductionDetails(data) {
  return request({
    url: '/plan/production/listPlanProductionDetails',
    method: 'post',
    data: data
  })
}
export function getPlanProductByMaterialId(data) {
  return request({
    url: '/plan/product/getPlanProductByMaterialId',
    method: 'post',
    data: data
  })
}
export function getInfo(data) {
  return request({
    url: '/plan/production/' + data,
    method: 'get'
  })
}
export function getMergeInfo(data) {
  return request({
    url: '/plan/production/getMergeInfo/' + data,
    method: 'get'
  })
}
export function repealDeliver(data) {
  return request({
    url: '/plan/production/repeal/' + data,
    method: 'get'
  })
}
export function finish(data) {
  return request({
    url: '/plan/production/finish/' + data,
    method: 'get'
  })
}
export function exportList(data) {
  return request({
    url: '/plan/production/jimureport?ids=' + data,
    method: 'get'
  })
}
export function expiry(data) {
  return request({
    url: '/plan/production/expiry/' + data,
    method: 'get'
  })
}
export function getLatestModel() {
  return request({
    url: '/plan/production/getLatestModel',
    method: 'get'
  })
}
export function requirement(data) {
  return request({
    url: '/engineering/requirement/getEngineeringRequirementsByMaterialId/' + data,
    method: 'get'
  })
}
export function jimureport(data) {
  return fileAPI({
    url: '/plan/product/jimureport?ids=' + data,
    responseType: 'arraybuffer',
    method: 'get'
  })
}
export function getPlanInfo(data) {
  return request({
    url: '/plan/product/' + data,
    method: 'get'
  })
}
export function remove(data) {
  return request({
    url: '/plan/production/delete',
    method: 'post',
    data: { deleteIds: data }
  })
}
export function addOrUpdate(data) {
  return request({
    url: '/plan/production/addOrEdit',
    method: 'post',
    data: data
  })
}
export function BOMList(data) {
  return request({
    url: '/engineering/bomDetail/list',
    method: 'post',
    data: data
  })
}
export function materialList(data) {
  return request({
    url: '/wms/material/listForSaleAndOut',
    method: 'post',
    data: data
  })
}
export function materialList2(data) {
  return request({
    url: '/wms/material/listForPlanProduction',
    method: 'post',
    data: data
  })
}
export function getAllPlanProductDetailList(data) {
  return request({
    url: '/plan/product/getAllPlanProductDetailList',
    method: 'post',
    data: data
  })
}
export function exportForProduct(data) {
  return request({
    url: '/plan/production/exportForProduct',
    method: 'post',
    data: data
  })
}

export function getEngineeringRequirementsByMaterialIds(data) {
  return request({
    url: '/engineering/requirement/getEngineeringRequirementsByMaterialIds',
    method: 'post',
    data: data
  })
}
